<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<head>
   	<jsp:include page="head.jsp"></jsp:include>
</head>
	<body style="margin:0;padding:0;height:100%;overflow:hidden;background:#F2FBFF">
	<form id="companyForm" >
		<input type="hidden" id="id" name="id" value=""/>
		<input type="hidden" id="companyid" name="companyid" value=""/>
	</form>
	<div id="mainlayout" class="easyui-layout" fit="true">
		<div region="north" border="false" >
			<div class="toolbar">
				<table cellpadding="0" cellspacing="0" style="width:95%;height:50px;" fit="true">
					<tr>
						<td>
							<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newItem()">新增部门</a>
							<a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editItem()">修改部门</a>
							<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" plain="true" onclick="delItem()">删除部门</a>
							<a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="lookItem()">查看部门信息</a>							
						</td>
					</tr>
				</table>
			</div>
		</div>
		
		<div region="west" border="false" style="border-right:1px solid #92B7D0;width:300px;padding:5px;">
			<div id="allTrees">
				<%=request.getAttribute("treeScript")%>
			</div>
		</div>
		<div region="center" border="false">
			<table id="dt-department" class="easyui-datagrid"
					url="<c:url value='/permissions/allDepartment.tg'/>"
					singleSelect="true" pagination="true"
					border="false" fit="true">
				<thead>
					<tr>
						<th field="id" width="50" >部门ID</th>
						<th field="deptName" width="100">部门名称</th>
						<th field="deptCode" width="100">部门编码</th>
						<th field="companyName" width="100">归属公司</th>
						<th field="status" width="100" formatter="statusFormatter">状态</th>
					</tr>
				</thead>
			</table>
		</div>
	</div>

				<!-- ==== -->
				
				
				<div id="dlg" class="easyui-dialog" style="width:430px;height:350px;"
						closed="true" modal="true" buttons="#dlg-buttons">
					<div style="padding-left:50px;padding-top:20px;">	
					<form id="myform" method="post">
						<table>
						<tr>
							<td>部门名称</td>
							<td>
								<input type="text" id="deptName" class="e-input" name="department.deptName" required="true" style="width:200px">
							</td>
						</tr>
						<tr>
							<td>部门编码</td>
							<td>
								<input type="text" id="deptCode" class="e-input" name="department.deptCode" required="true" style="width:200px">
							</td>
						</tr>
						<tr>
							<td>所属部门</td>
							<td>
								<input id="parentId" name="department.parentId" class="easyui-combotree" style="width:200px" ></input>
							</td>
						</tr>												
						<tr>
							<td>所属公司</td>
							<td>
								<input id="companyId" name="department.companyId" class="easyui-combotree" style="width:200px" ></input>
							</td>
						</tr>
						<tr>
							<td>状态</td>
							<td>
							<input id="status" class="easyui-combobox"  name="department.status" style="width:200px" 
									required="true" readonly="true" panelHeight="auto"
									url="<c:url value='/permissions/outDicJsonByNicknameActions.tg?nickName=status'/>"
									valueField="value" textField="name">
							</td>
						</tr>
						
						<tr>
							<td>排序</td>
							<td><input type="text" id="orderId" class="e-input" name="department.orderId" style="width:200px"></input></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td>
								<input type="hidden" id="eid" name="department.id" value="1">
							</td>
						</tr>						
					</table>
					</form>
					</div>
					<div id="dlg-buttons" style="text-align:center">
						<a href="#" class="easyui-linkbutton" iconCls="icon-save" onclick="saveItem()">保存</a>
						<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">关闭</a>
					</div>
				</div>
				
				<div id="look" style="width:430px;height:350px;"
			class="easyui-dialog" closed="true" modal="true" buttons="#dlg-buttons">
		<div style="padding-left:50px;padding-top:20px;">
			<div style="float:center">
				<form id="myform" method="post" style="margin:0;padding:0">
					<table>
						<tr>
							<td>部门名称</td>
							<td>
								<input readonly type="text" id="ldeptName" class="e-input" name="department.deptName"  style="width:200px">
							</td>
						</tr>
						<tr>
							<td>部门编码</td>
							<td>
								<input readonly type="text" id="ldeptCode" class="e-input" name="department.deptCode" style="width:200px" >
							</td>
						</tr>
						<tr>
							<td>所属部门</td>
							<td>
								<input readonly type="text" id="lparentId" class="e-input" name="department.parentId" style="width:200px" >
							</td>
						</tr>											
						<tr>
							<td>所属公司</td>
							<td>
								<input readonly type="text" id="lcompanyId" class="e-input" name="department.companyId" style="width:200px" >
							</td>
						</tr>						
						<tr>
							<td>排序</td>
							<td><input readonly type="text" id="lorderid" class="e-input" name="department.orderId" style="width:200px"></input></td>
						</tr>
						<tr>
							<td>状态</td>
							<td><input readonly type="text" id="lstatus" class="e-input" name="department.status" style="width:200px"></input></td>
						</tr>
					</table>
				</form>
			</div>
			<div style="clear:both"></div>
		</div>
		<div id="dlg-buttons" style="text-align:center;">
			<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#look').dialog('close')">关闭</a>
		</div>
	</div>
			
</body>